package com.sf.marathon.soul.core.base;

import java.io.Serializable;

import lombok.Data;

/**
 * 统一返回json的结果封装类
 *
 * @since version1.0
 * @author  01368146 2017/5/10
 */
@Data
public class JsonResult<T> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    private boolean success = true;
    /**
     * 信息码
     */
    private String errCode = ResultCodeEnum.SUCCESS.value();
    /**
     * 业务提示信息
     */
    private String message = "success";

    /**
     * 返回的数据
     */
    private T data;

    public JsonResult() {
    }

    public JsonResult(ResultCodeEnum codeEnum) {
        this.errCode = codeEnum.value();
        this.message = codeEnum.info();
    }
}
